import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/sysRest/token',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/userRest/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/sysRest/logout',
    method: 'post'
  })
}

/**
 * 验证码
 * @returns {AxiosPromise}
 */
export function refreshCode() {
  return request({
    url: '/sysRest/captcha',
    method: 'get'
  })
}


export function getUserMenus(){
  return request({
    url:'/permissionRest/userMenus',
    method:'get'
  })
}
